home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Trusted Irix /B 4.0.4
/
Trusted-Irix B-4.0.1.iso
/
dist
/
eoe1.idb
/
usr
/
include
/
sys
/
fs
/
efs_sb.h.z
/
efs_sb.h
Wrap
C/C++ Source or Header
|
1992-04-03
|
6KB
|
140 lines
/**************************************************************************
* *
* Copyright (C) 1988, Silicon Graphics, Inc. *
* *
* These coded instructions, statements, and computer programs contain *
* unpublished proprietary information of Silicon Graphics, Inc., and *
* are protected by Federal copyright law. They may not be disclosed *
* to third parties or copied or duplicated in any form, in whole or *
* in part, without the prior written consent of Silicon Graphics, Inc. *
* *
**************************************************************************/
#ifndef __EFS_SB_
#define __EFS_SB_
#ident "$Revision: 3.13 $"
/*
* Structure of the extent filesystem superblock
*/
/*
* Software summary structure per cylinder group. When a filesystem is
* mounted, the system builds a cylinder group table for containing summary
* allocation information.
*/
struct cg {
daddr_t cg_firstbn; /* first bn in cg */
daddr_t cg_firstdbn; /* first data block bn */
ino_t cg_firsti; /* first inode # in cg */
/*
* Inode allocation summary information. We keep a simple rotor
* which tracks the lowest free inode for a given cg.
* We also keep a 'generation number' to control updating of this:
* if, during the search, an ifree occurred while we had reliquished
* the fs_semlock, our info is no longer up to date so we should
* not advance it.
*/
ino_t cg_lowi; /* lowest inode # that's free */
unsigned cg_gen;
/*
* Data allocation summary information. When the cg is scanned,
* we build up information about the total number of free data
* blocks, as well the first free data block.
*/
long cg_dfree; /* count of free data blocks */
daddr_t cg_firstdfree; /* first free data bn */
};
/* structure of the super-block for the extent filesystem */
struct efs {
/*
* This portion is read off the volume
*/
long fs_size; /* size of filesystem, in sectors */
long fs_firstcg; /* bb offset to first cg */
long fs_cgfsize; /* size of cylinder group in bb's */
short fs_cgisize; /* bb's of inodes per cylinder group */
short fs_sectors; /* sectors per track */
short fs_heads; /* heads per cylinder */
short fs_ncg; /* # of cylinder groups in filesystem */
short fs_dirty; /* fs needs to be fsck'd */
time_t fs_time; /* last super-block update */
long fs_magic; /* magic number */
char fs_fname[6]; /* file system name */
char fs_fpack[6]; /* file system pack name */
long fs_bmsize; /* size of bitmap in bytes */
long fs_tfree; /* total free data blocks */
long fs_tinode; /* total free inodes */
long fs_bmblock; /* bitmap location. */
long fs_replsb; /* Location of replicated superblock. */
char fs_spare[24]; /* space for expansion - MUST BE ZERO */
long fs_checksum; /* checksum of volume portion of fs */
/*
* The remainder is used for in-core manipulation. During
* super-block creation, and possible writing in the root's case,
* these fields will be written to disk. It is assumed when
* the super-block is read in that these fields contain trash,
* and are accordingly initialized.
*/
char fs_readonly; /* device is read-only */
char fs_fmod; /* filesystem has been modified */
char fs_corrupted; /* fs is corrupted; no more write's */
char fs_freedblock; /* freed a block so disk may not be diskfull */
long fs_diskfull; /* had to do a brute search for data blocks */
dev_t fs_dev; /* device fs is mounted on */
short fs_inopchunk; /* # of inodes in an inode chunk */
daddr_t fs_inopchunkbb; /* # of bb's in an inode chunk, rounded up */
short fs_minfree; /* min # of free blocks for file placement */
short fs_mindirfree; /* min # of free blocks for dir placement */
ino_t fs_ipcg; /* # of inodes per cg */
ino_t fs_lastinum; /* last inum in fs */
ushort fs_lbshift; /* logical block shift */
struct sema_s *fs_semlock; /* file system semaphore */
/*
* An array of cg structs is managed here. During mounting
* the size of this structure plus the number of cg structs
* that will be needed, minus 1 (because of the one defined below),
* is dynamically allocated. This makes it easy to do quick looking
* through the cg structs for allocation/de-allocation.
*/
struct cg fs_cgs[1]; /* actually, there are more here */
};
#define EFS_MAGIC 0x072959L
/* IRIX 3.3 filesystems need a new
* magic number to ensure there's no attempt to (disasterously!) use
* them on a pre-3.3 system.
*/
#define EFS_NEWMAGIC 0x07295a
#define IS_EFS_MAGIC(x) ((x == EFS_MAGIC) || (x == EFS_NEWMAGIC))
/*
* Values for fs_dirty. If a filesystem was cleanly unmounted, and started
* clean before being mounted then fs_dirty will be EFS_CLEAN. Otherwise,
* the filesystem is suspect in one of several ways. If it was a root
* filesystem and had to be mounted even though it was dirty, the fs_dirty
* flag gets set to EFS_ACTIVEDIRT so that user level tools know to
* clean the root filesystem. If the filesystem was clean and is mounted,
* then the fs_dirty flag gets set to EFS_ACTIVE. EFS_DIRTY is a particular
* value to assign fs_dirty to when a filesystem is known to be dirty.
*/
#define EFS_CLEAN 0x0000 /* unmounted && clean */
#define EFS_ACTIVEDIRT 0x0BAD /* mounted a dirty fs (root only) */
#define EFS_ACTIVE 0x7777 /* mounted && clean */
#define EFS_DIRTY 0x1234 /* random value for dirtyness */
#ifdef _KERNEL
#define efs_getfs(mp) ((struct efs *) (mp)->m_bufp)
#endif
#endif /* __EFS_SB_ */